borderimage: Use a GtkCssStyle instead of GtkStyleContext
authorBenjamin Otte <otte@redhat.com>
Sat, 17 Jan 2015 04:27:23 +0000 (05:27 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 20 Jan 2015 00:23:19 +0000 (01:23 +0100)
gtk/gtkborderimage.c
gtk/gtkborderimageprivate.h
gtk/gtkrender.c

index 21e2c35ec163d98b057fb87aec98a9439b246342..58a43f802efc7571aef2e9df119563389cfcb4e3 100644 (file)
@@ -29,7 +29,7 @@
 #include "gtkcssimagevalueprivate.h"
 #include "gtkcssnumbervalueprivate.h"
 #include "gtkcssrepeatvalueprivate.h"
-#include "gtkstylepropertyprivate.h"
+#include "gtkcssstyleprivate.h"
 
 /* this is in case round() is not provided by the compiler, 
  * such as in the case of C89 compilers, like MSVC
 #include "fallback-c89.c"
 
 gboolean
-_gtk_border_image_init (GtkBorderImage   *image,
-                        GtkStyleContext  *context)
+_gtk_border_image_init (GtkBorderImage *image,
+                        GtkCssStyle    *style)
 {
-  image->source = _gtk_css_image_value_get_image (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE));
+  image->source = _gtk_css_image_value_get_image (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE));
   if (image->source == NULL)
     return FALSE;
 
-  image->slice = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE);
-  image->width = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH);
-  image->repeat = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT);
+  image->slice = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE);
+  image->width = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH);
+  image->repeat = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT);
 
   return TRUE;
 }
index c82fe82cc9aacfaf1f7d0b9f1efc7195e49cd5b8..90a8326804756ce96ff726129e9a6705b082ec2e 100644 (file)
@@ -39,7 +39,7 @@ struct _GtkBorderImage {
 };
 
 gboolean          _gtk_border_image_init             (GtkBorderImage       *image,
-                                                      GtkStyleContext      *context);
+                                                      GtkCssStyle          *style);
 
 void              _gtk_border_image_render           (GtkBorderImage       *image,
                                                       const double          border_width[4],
index b702a07cc77f1ce69dbe0192205553092bfcdc57..db81b0efe6ee1910fc68f3bbc6fdab60d31b80b8 100644 (file)
@@ -909,7 +909,7 @@ render_frame_internal (GtkStyleContext  *context,
   border_width[2] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
   border_width[3] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
 
-  if (_gtk_border_image_init (&border_image, context))
+  if (_gtk_border_image_init (&border_image, gtk_style_context_lookup_style (context)))
     {
       _gtk_border_image_render (&border_image, border_width, cr, x, y, width, height);
     }